public class Main {
    public static void main(String[] args) {
        Broker broker = new BrokerImple();
        Producer producer = new producerImple(broker);
        ConsumerImple subscriber1 = new ConsumerImple("subscriber1");
        ConsumerImple subscriber2 = new ConsumerImple("subscriber2");
        ConsumerImple subscriber3 = new ConsumerImple("subscriber3");

        broker.subscribe("朋友圈",subscriber1);
        broker.subscribe("朋友圈",subscriber2);

        producer.publish(new StringMessage("朋友圈","今天天气真好"));

        broker.unsubscribe("朋友圈",subscriber2);

        producer.publish(new StringMessage("朋友圈","今天天气不好"));

    }
}
